package com.yanqu.road.entity.enums.rank;

import com.yanqu.road.entity.enums.eActivityType;
import com.yanqu.road.entity.enums.eChannelRankActivityType;
import com.yanqu.road.entity.enums.eGamePlayerEventType;

import java.util.ArrayList;
import java.util.List;

public enum eRankInfo {

    ChannelIntimacyRiseUserRank(
            "跨区域个人亲密榜",
            eActivityType.ChannelRankActivity,
            eChannelRankActivityType.ChannelIntimacyRiseRank.getValue(),
            eGamePlayerEventType.IntimacyRiseRank.getValue(),
            eRankRangeType.User),
    ChannelIntimacyRiseChannelRank(
            "跨区域区域亲密榜",
            eActivityType.ChannelRankActivity,
            eChannelRankActivityType.ChannelIntimacyRiseRank.getValue(),
            eGamePlayerEventType.ServerIntimacyRiseRank.getValue(),
            eRankRangeType.Channel),

    ChannelAbilityRiseUserRank(
            "跨区域个人门客榜",
            eActivityType.ChannelRankActivity,
            eChannelRankActivityType.ChannelAbilityRiseRank.getValue(),
            eGamePlayerEventType.AbilityRiseRank.getValue(),
            eRankRangeType.User),
    ChannelAbilityRiseChannelRank(
            "跨区域区域门客榜",
            eActivityType.ChannelRankActivity,
            eChannelRankActivityType.ChannelAbilityRiseRank.getValue(),
            eGamePlayerEventType.ServerAbilityRiseRank.getValue(),
            eRankRangeType.Channel),

    ChannelChildEarnSpeedRiseUserRank(
            "跨区域个人子嗣榜",
            eActivityType.ChannelRankActivity,
            eChannelRankActivityType.ChannelChildEarnSpeedRiseRank.getValue(),
            eGamePlayerEventType.ChildEarnSpeedRiseRank.getValue(),
            eRankRangeType.User),
    ChannelChildEarnSpeedRiseChannelRank(
            "跨区域区域子嗣榜",
            eActivityType.ChannelRankActivity,
            eChannelRankActivityType.ChannelChildEarnSpeedRiseRank.getValue(),
            eGamePlayerEventType.ServerChildEarnSpeedRiseRank.getValue(),
            eRankRangeType.Channel),

    ChannelWasheScoreSmallUserRank(
            "跨区域瓦舍夺魁个人荣誉点榜单",
            eActivityType.ChannelRankActivity,
            eChannelRankActivityType.ChannelWasheScoreSmallRank.getValue(),
            eGamePlayerEventType.WasheScoreSmallRank.getValue(),
            eRankRangeType.User),

    ChannelGlamourRiseUserRank(
            "跨区域个人亲密榜",
            eActivityType.ChannelRankActivity,
            eChannelRankActivityType.ChannelGlamourRiseRank.getValue(),
            eGamePlayerEventType.GlamourRiseRank.getValue(),
            eRankRangeType.User),
    ChannelGlamourRiseChannelRank(
            "跨区域区域亲密榜",
            eActivityType.ChannelRankActivity,
            eChannelRankActivityType.ChannelGlamourRiseRank.getValue(),
            eGamePlayerEventType.ServerGlamourRiseRank.getValue(),
            eRankRangeType.Channel),

    ChannelEarnSpeedRiseUserRank(
            "跨区域个人亲密榜",
            eActivityType.ChannelRankActivity,
            eChannelRankActivityType.ChannelEarnSpeedRiseRank.getValue(),
            eGamePlayerEventType.EarnSpeedRiseRank.getValue(),
            eRankRangeType.User),
    ChannelEarnSpeedRiseChannelRank(
            "跨区域区域亲密榜",
            eActivityType.ChannelRankActivity,
            eChannelRankActivityType.ChannelEarnSpeedRiseRank.getValue(),
            eGamePlayerEventType.ServerEarnSpeedRiseRank.getValue(),
            eRankRangeType.Channel),


    ChannelMusicRoomUserRank(
            "跨区域百花争艳个人榜单",
            eActivityType.ChannelMusicRoomRank,
            1,
            eGamePlayerEventType.MusicRoomScoreRank.getValue(),
            eRankRangeType.User),

    ChannelMusicRoomChannelRank(
            "跨区域百花争艳区域榜单",
            eActivityType.ChannelMusicRoomRank,
            1,
            eGamePlayerEventType.ServerMusicRoomScoreRank.getValue(),
            eRankRangeType.Channel),

    ChannelBeautyEscortUserRank(
            "跨区域押镖个人榜单",
            eActivityType.ChannelRankActivity,
            eChannelRankActivityType.ChannelBeautyEscortRank.getValue(),
            eGamePlayerEventType.OnlyEscortAddExpRank.getValue(),
            eRankRangeType.User),

    ChannelBeautyEscortChannelRank(
            "跨区域押镖区域榜单",
            eActivityType.ChannelRankActivity,
            eChannelRankActivityType.ChannelBeautyEscortRank.getValue(),
            eGamePlayerEventType.ServerOnlyEscortAddExpRank.getValue(),
            eRankRangeType.Channel),



    ;

    private String name;

    private eActivityType activityType;
    private int childType; // -1表示忽略
    private int conditionType;

    private eRankRangeType rangeType; // 范围

    public static eRankInfo getERankInfo(int activityType, int childType, int conditionType) {
        for (eRankInfo rankInfo : eRankInfo.values()) {
            if (rankInfo.getActivityType().getValue() != activityType) continue;
            if (rankInfo.getChildType() != childType && rankInfo.getChildType() != -1) continue;
            if (rankInfo.getConditionType() == conditionType) return rankInfo;
            continue;
        }
        return null;
    }

    public static List<eRankInfo> getERankInfoList(int activityType, int childType) {
        List<eRankInfo> eRankInfoList = new ArrayList<>();
        for (eRankInfo rankInfo : eRankInfo.values()) {
            if (rankInfo.getActivityType().getValue() != activityType) continue;
            if (rankInfo.getChildType() != childType && rankInfo.getChildType() != -1) continue;
            eRankInfoList.add(rankInfo);
        }
        return eRankInfoList;
    }

    eRankInfo(String name, eActivityType activityType, int childType, int conditionType, eRankRangeType rangeType) {
        this.name = name;
        this.activityType = activityType;
        this.childType = childType;
        this.conditionType = conditionType;
        this.rangeType = rangeType;
    }

    public eActivityType getActivityType() {
        return activityType;
    }

    public int getChildType() {
        return childType;
    }

    public int getConditionType() {
        return conditionType;
    }

    public eRankRangeType getRangeType() {
        return rangeType;
    }

}
